package Demo;

import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode tree = binaryTree.createTree();
        binaryTree.preOrder(tree);
        System.out.println();
        System.out.println("1111");
        System.out.println(binaryTree.nodeSize(tree));
        System.out.println(binaryTree.getLeafNodeCount(tree));
        System.out.println(binaryTree.getKLevelNodeCount(tree,2));
        System.out.println(binaryTree.getHeight(tree));

        List<Character> leftView = binaryTree.leftViewBFS(tree);
        System.out.println("二叉树的左视图: " + leftView);

        boolean completeTree = binaryTree.isCompleteTree(tree);
        System.out.println(completeTree);

        binaryTree.preOrder(tree);//非递归前序遍历
        System.out.println();

        binaryTree.inOrderTraversal(tree);//非递归中序遍历
        System.out.println();

        List<Character> postOrderTraversal = binaryTree.postOrderTraversal(tree);//非递归后序遍历
        System.out.println(postOrderTraversal);
    }
}
